<?php

class BaseDAO {

    public $em;
    public $doctrine;

    function __construct() {
        /* Instantiate Doctrine's Entity manage so we don't have
          to everytime we want to use Doctrine */
        $this->doctrine = new Doctrine();
        $this->em = $this->doctrine->em;
    }
	
    public function guardar($array) {
        foreach ($array as $entidad)
            $this->em->persist($entidad);
        $this->em->flush();
    }
    
    public function getEM(){
        return $this->em;
    }
    
    public function setEM($em){
        $this->em = $em;
    }

}

?>
